package org.yangyuan.pay.config;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.yangyuan.pay.bean.aliPayConfigInjector;


/**
 * 支付宝支付全局统一配置
 *
 * @author yangyuan
 * @date 2017年4月28日
 */
@Configuration
public class AliPayConfig {

    //        @Value("${pay.ali.appid:}")
    private String _appid = "2021001177633558";

    //        @Value("${pay.ali.privateKey:}")
    private static String _privateKey ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQClFnphytSXWsl+eiA5KZwjfH6DUApFBXhkvAJbBYOO1iFDYGnvLfXTcWhqUysSkVQeVWVVT5z2eMHkluDwLeqO7MjoHRixy3y1qIFD/0V3Ab+X0MS0NfPFTag4X1o+6I6Z//+1JjqwYxnK9uE6feqIagAMyrgM2l5PLvQPbMCr4PwO5xp+W5OCWLM4SuGorDmjLa8xb5cCptAAlJl1KA5WQ5aLzCdDMeb9Hk6DPyd0Rb4gytBEMADakrpGrvyd/+ZixCe8gGPR8VA1X7LPySKIOTL2KbeDq25vUALoZKr1dKFLjfc+U1Eh0fATaJBKHTXhp+QnHEn0CJw8hLObk/z/AgMBAAECggEAPXN3jK1eoxRlSpIVKpIFj+QIh8Kkf/rATOb7DXyo8uNcMGNUK3b1OYbOcj2RG/FC2aO5+56N8+URb5CGHIFK/XbAdj5WceAoBMq7i18bMWhSNCW/AsHOgtQcWReNVTtl0YdMXNblI8FP2ZA6WHaEddDXQeu3xPkH//ufV5qIwbF9D1ZWjncUaozt2RI7mRoX6/TYYNcc7Uc8oHr4/v+nW3x9DoUyJMeygAZZtARGX9AxeoFJlBn+s9ah3jLwFgUUYicrHdTFirdvrlOtf++jbuftKru5jCftsollj3h6UnsikLNnPI/NnsE/uz3tkSPU+Q9S55D6ilL3x6csatXWAQKBgQDhZ995hpy0jQ+dwTxr7lhSD/hruibqwGwOnD/wpkGC9jKIn0pm7hLaq8ojKluc5PVK9/TDVsWLM3YABDCtZPRVm+pAJ0Txa3VTRkm9OoNlwY1E2yz8LnzXTNlsbyZsObTkVm8Fy6WmELZcHAwolQexllE7Eg6tNbtuim8fwwGfAQKBgQC7fr/0yPek+6F1sdJf/ck/a11uTjnzyrj/qn9as7bjPVqvTL6GesZ3OPahCyZc1jSYiBpKs4PDNyCyhwgM0/nmZP1BhCDUjj8DlD8Q4cWaNAkrCXFGUN/dw7kLg5mrqTubtuGuG88cTR0QItSa1/uVxJJx5Uvh3SX7hH0RcrGb/wKBgER4jUYZQhkGkKvXO0d+C45CE7CFx7Sf5zM4+6NanaPurcMawDssLsYGUU0FXPb4BhtT3yJHhZKXe0zd+PtzI1WuGyaJx0Oe5PD69QNqdue+N++mtK+WX433ZkSuLvnJPc3vA6K7DgK4KO0qB/d77e5gPyS2g4bSP7GAk+kOD7wBAoGAW9UJ6bfg63K/syikVJW10xUgDt3LrqeVEswMUn2BTy2G1CNvkehiepRw35HZeVEFM8w9rGbeW2gN4MMYY0gTtw+xpzwy5EjDflpGxVr/cLaZ4vVeAMWt0C2D3arYQmbCJlNdl+xQ9ZijanrUzP6KX+GGpLhdAURSzS0oILqfWTsCgYAAyCf89OlPAdbysvokE5XxT1UEHkThaSt7NQ/ePWK0lNelYnWyqDi0t3ltRphrHnG4L++9EYsYFc37IgD1QElxdyKBXk81yaOK6DQr9Q1dsVRLScs4MkWCtr1oTmbnWtPQ7TOJbDY1IzavlEaCKuGHK8wF9MltiHVSVn7d++0VBg==";


    //        @Value("${pay.ali.notifyURL:}")
    private String _notifyURL="";

    /**
     * 应用ID
     */
    private static String appid= "2021001177633558";
    /**
     * 商户的私钥
     */
    private static String privateKey="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQClFnphytSXWsl+eiA5KZwjfH6DUApFBXhkvAJbBYOO1iFDYGnvLfXTcWhqUysSkVQeVWVVT5z2eMHkluDwLeqO7MjoHRixy3y1qIFD/0V3Ab+X0MS0NfPFTag4X1o+6I6Z//+1JjqwYxn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kOD7wBAoGAW9UJ6bfg63K/syikVJW10xUgDt3LrqeVEswMUn2BTy2G1CNvkehiepRw35HZeVEFM8w9rGbeW2gN4MMYY0gTtw+xpzwy5EjDflpGxVr/cLaZ4vVeAMWt0C2D3arYQmbCJlNdl+xQ9ZijanrUzP6KX+GGpLhdAURSzS0oILqfWTsCgYAAyCf89OlPAdbysvokE5XxT1UEHkThaSt7NQ/ePWK0lNelYnWyqDi0t3ltRphrHnG4L++9EYsYFc37IgD1QElxdyKBXk81yaOK6DQr9Q1dsVRLScs4MkWCtr1oTmbnWtPQ7TOJbDY1IzavlEaCKuGHK8wF9MltiHVSVn7d++0VBg==";
    /**
     * 支付回调地址
     */
    private static String notifyURL = "";
    /**
     * 支付宝网关
     */
    private static String gateway = "https://openapi.alipay.com/gateway.do";
    /**
     * 支付宝的公钥
     */
    private static String aliPublicKey="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxNkQZaTY5cjSx3lFJ+XF7BwboEr9tdwKMnfIW9kQlg+lenbbyzAKJV9ntGdcK6PoAAqrlXthaBBQwXmWvPXNLROa8Q/4kxzY0oxcG3m8Yw2qTb6nwCDmYrPadXQMqyO6CgNFDSMWVzbDtLHl90+6rf09nRhgyKhavpjmnFNlsLxIAH9m6YulUP/DNJLipF2Gyy+bjDNwKoLcKO9I3QL+MpSF5Zwzt/DI0AtMpdiWoGmZtMP57kg5YyTdE55JfFGEsgdNPy9zcKmAVy1RtkCck8EoZKciSAb2vsLOq/T+g9Ym7/XOEwt0gCecnskWOiGzAzFAbtEQs4tM0aAqCGv8OQIDAQAB";

    @Bean("aliPayConfigInjector")
    public aliPayConfigInjector aliPayConfigInjector() {
        aliPayConfigInjector aliPayConfigInjector=new aliPayConfigInjector();
        appid = _appid;
        privateKey = _privateKey;
        notifyURL = _notifyURL;
        aliPayConfigInjector.setAppid(_appid);
        aliPayConfigInjector.setPrivateKey(_privateKey);
        return aliPayConfigInjector;
    }

    public static String getAppid() {
        return appid;
    }

    public static String getPrivateKey() {
        return privateKey;
    }

    public static String getNotifyURL() {
        return notifyURL;
    }

    public static String getGateway() {
        return gateway;
    }

    public static String getAliPublicKey() {
        return aliPublicKey;
    }
}
